<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Get default marker - ExtStreetviewControl</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAjU0EJWnWPMv7oQ-jjS7dYxQGj0PqsCtxKvarsoS-iqLdqZSKfxRdmoPmGl7Y9335WLC36wIGYa6o5Q" type="text/javascript"></script>
    <script type="text/javascript">
    document.write('<script type="text/javascript" src="../src/extstreetviewcontrol'+(document.location.search.indexOf('packed')>-1?'_packed':'')+'.js"><'+'/script>');
  </script>
    <script type="text/javascript">

    var extStreetviewControl = null;
    var ctrlMarker = null;

    function initialize () {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(38.892096,-77.03651), 17);
        
        //add the ExtStreetviewControl
        var opts = {
          size : new GSize(300, 300),
          mainContent : "STREETVIEW"
        };
        extStreetviewControl = new ExtStreetviewControl(opts);
        map.addControl(extStreetviewControl);
        
        //get default marker's handle
        ctrlMarker = extStreetviewControl.getMarker();
        ctrlMarker.openInfoWindow("Near the White House in US");
        GEvent.addListener(ctrlMarker, "click", onCtrlMarkerClick);

        map.addOverlay(new GStreetviewOverlay());
      }
    }
    
    function onCtrlMarkerClick (latlng) {
      var txt = ctrlMarker.getLatLng() + "<br>";
      var pov = extStreetviewControl.getPov();
      txt += "yaw:" + pov.yaw + "<br>";
      txt += "pitch:" + pov.pitch + "<br>";
      txt += "zoom:" + pov.zoom;
      ctrlMarker.openInfoWindowHtml(txt);
    }
    </script>
  </head>
  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 100%; height: 90%"></div>
    <h4>Get default marker - ExtStreetviewControl</h4>
    <p>
    You can get a handle of default marker using by the "getMarker" method.
    </p>

  </body>
</html>

